
#include "test_driver.h"


inline void printStr(const char* str, int start, int len) {
	for(int i = start; i < start + len; i++) {
		cout << str[i];
	}
}

void test_ReadSet() {
	string fileName = "/lhome/mian/data/temp.fastq";
	const int readLength = 100;
	ReadSet* readSet = new ReadSet(fileName, readLength);
	const int numReadFetchPerWindow = 2;
	char* base = new char[readLength*numReadFetchPerWindow];
	char* qscore = new char[readLength*numReadFetchPerWindow];
	int numFetched = 0;

	while((numFetched = readSet->fetch(base, qscore, numReadFetchPerWindow)) && 
		(numFetched > 0)) {
		cout << "numFetched: " << numFetched << endl;

		for(int i = 0; i < numFetched; i++) {
			printStr(base, i*readLength, readLength);
			cout << endl;
			printStr(qscore, i*readLength, readLength);
			cout << endl;
		}
	}

	delete[] base;
	delete[] qscore;
}

